var a = "";
var b = "";
var jianli = "";
var qe = "";
var te = "";
var t = "";
var t1 = "";
var pwdChange = "";


$.post("../userinfo/getTe",
    function () {

    })
    .success(function (data, status) {
        $.each(data, function (index, item) {
            te = te + "<tr><td>" + index + "</td><td>" + item + "</td></tr>";

        })
        te = "</tr><tr><th>结对</th>" + te + "</tr></table>";
    }).error(function (data, status) {
})
$.post("../userinfo/getQe",
    function () {

    })
    .success(function (data, status) {
        $.each(data, function (index, item) {
            qe = qe + "<tr><td>" + index + "</td><td>" + item + "</td></tr>";

        })
        qe = "<table class='table'><tr>" + "<th>竞赛</th>" + qe;

    }).error(function (data, status) {
})
$.post("../userinfo/getInfo",
    function () {

    })
    .success(function (data, status) {
        var age = data.age;
        if (age == null)
            age = "";
        if (age == "null")
            age = "";
        a = "<div style='position:absolute;top:50px;left: 150px;width: 400px; height: 40px;'><b><font style='font-size: 300%;font-family: 宋体;'> " + data.name + "</font></b></div>" +
            "<div style='position:absolute;top:110px;left: 150px;width: 300px; height: 20px;'><font style='font-size: 100%;color: #8c8c8c'> " + data.charactern + "</font></div>" +
            "<div style='position:absolute;top:50px;left: 500px;width: 100px; height: 100px;'>            <img src='" + data.photo + "' width='100px' height='100px'>" + "</div>" +
            "<div style='position:absolute;top:200px;width: 636px; height: auto;min-height: 200px;margin: 20px 70px 0px 70px;'>" +
            //                    "<hr style=' height:2px;border:none;border-top:2px dotted #185598;' />" + data.userId +
            "<hr style='border-top-width: 1px; border-top-style: solid; border-top-color: #d9d9d9;;margin:0' />"
            //                + data.projects +
            //                + data.leader +
            //                + data.prizeId +
            + "<p>&nbsp;"
            + "<p><font style='font-size: 100%;color: #8c8c8c'>性别：" + data.sex
            + "<p><font style='font-size: 100%;color: #8c8c8c'>年龄：" + age
            + "<p><font style='font-size: 100%;color: #8c8c8c'>邮箱：" + data.mail
            + "<p><font style='font-size: 100%;color: #8c8c8c'>电话：" + data.phone
            + "<p><font style='font-size: 100%;color: #8c8c8c'>户籍：" + data.nativeplace
            + "<p><font style='font-size: 100%;color: #8c8c8c'>现居：" + data.city
            + "<p><font style='font-size: 100%;color: #8c8c8c'>学历：" + data.educationexp
            + "<p><font style='font-size: 100%;color: #8c8c8c'>专业：" + data.profession
            + "<p><font style='font-size: 100%;color: #8c8c8c'>英语水平：" + data.englishlevel
            + "<p><font style='font-size: 100%;color: #8c8c8c'>职业：" + data.functions
            + "<p><font style='font-size: 100%;color: #8c8c8c'>自我介绍：<p>&emsp;" + data.selfassessment
            + "<p><button id='jianli' type='button' class='btn btn-default'>导出简历</button>";


        var sss = "  <input type='radio' name='gender' value='男' >男\n" +
            " <input type='radio' name='gender' value='女' >女"
        if (data.sex == "男") {
            sss = "  <input type='radio' name='gender' value='男' checked>男\n" +
                " <input type='radio' name='gender' value='女' >女"
        }
        if (data.sex == "女") {
            sss = "  <input type='radio' name='gender' value='男' >男\n" +
                " <input type='radio' name='gender' value='女' checked>女"
        }


        pwdChange =             "    <link href='../css/register.bundle.css' rel='stylesheet'>" +
            "    <link href='../css/bootstrap.min.css' rel='stylesheet'>" +
            "    <link href='../css/cropper.min.css' rel='stylesheet'>" +
            "    <link href='../css/img-main.css' rel='stylesheet'>" +
            "<div style='position:absolute;top:100px;width: 636px; z-index: 9999; height: 116px;background-color: #EEEEEE'></div>" +
            "<div style='position:absolute;top:200px;width: 636px; height: 100px;left: 200px;'>" +
            +"<p>&nbsp;"
            + "<table>" +
            "<tr><td>原密码</td><td><div class='col-sm-10'><input type='password' id='oldPwd' class='form-control' ></div></td></tr>" +
            "<tr><td>新密码</td><td><div class='col-sm-10'><input type='password' id='newPwd' class='form-control' ></div></td></tr>" +
            "<tr><td>确认密码</td><td><div class='col-sm-10'><input type='password' id='newPwdConfirm' class='form-control'></div></td></tr>" +
            "<tr><td>&nbsp</td><td>&nbsp</td></tr>" +
            "</table>" +
            "<p class='erro ng-binding' id='wrongMsg' style='height:17px'></p>" +
            "<div style='position: absolute;top:200px;width: 636px; height: 100px;left: 100px;'><button type='button' id='sub2' class='btn btn-success'>提交</button></div>"
            + "</div>" +
            "<script type='text/javascript'>" +
            "    $('document').ready(function () {" +
            "" +
            "        $('#sub2').click(function () {" +
            "" +
            "           $.post('../userinfo/judgeOldPwd', {password: $('#oldPwd').val()}," +
            "           function(data){" +
            "               if(data == true){" +
            "                   if(!$('#newPwd').val().match(/^[0-9a-zA-Z]{6,16}$/)){" +
            "                        $('#wrongMsg').text('密码限6~16个字符，字母(区分大小写)或数字及组合！');" +
            "                        return;" +
            "                   }else{" +
            "                        if($('#newPwdConfirm').val() != $('#newPwd').val()){" +
            "                           $('#wrongMsg').text('两次密码不一致！');" +
            "                           return;" +
            "                         }else{" +
            "                             $('#wrongMsg').text('');" +
            "                              $.post('../userinfo/changePwd',{password:$('#newPwd').val()}," +
            "                                   function (data) {  " +
            "                                       $('#oldPwd').val('');" +
            "                                       $('#newPwd').val('');" +
            "                                       $('#newPwdConfirm').val('');" +
            "                                       alert('修改成功') " +
            "                               })" +
            "                            }" +
            "                  }" +
            "               }else{" +
            "                   $('#wrongMsg').text('原密码错误');" +
            "                   return;" +
            "               }" +
            "           });" +
            "        })" +
            "    })" +
            "</script>" +
            "<script src='../js/jquery.min.js'></script>" +
            "<script src='../js/bootstrap.min.js'></script>" +
            "<script src='../js/cropper.min.js'></script>" +
            "<script src='../js/img-main.js'></script>" ;


        b = "<!DOCTYPE html>\n" +
            "<html lang=\"en\">\n" +
            "<head>\n" +
            "    <meta charset=\"utf-8\">\n" +
            "    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n" +
            "    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n" +
            "    <meta name=\"description\" content=\"A complete example of Cropper.\">\n" +
            "    <meta name=\"keywords\" content=\"HTML, CSS, JS, JavaScript, jQuery, PHP, image cropping, web development\">\n" +
            "    <meta name=\"author\" content=\"Fengyuan Chen\">\n" +
            "    <title>Crop Avatar - Cropper</title>\n" +
            "    <link href=\"../css/bootstrap.min.css\" rel=\"stylesheet\">\n" +
            "    <link href=\"../css/cropper.min.css\" rel=\"stylesheet\">\n" +
            "    <link href=\"../css/img-main.css\" rel=\"stylesheet\">\n" +
            "</head>\n" +
            "<body>\n"
            + "<div class='col-sm-10' style='position:absolute;top:50px;left: 130px;width: 200px; height: 40px;'>姓名<input type='text' id='name' class='form-control' value='" + data.name + "'></div>" +
            "<div class='col-sm-10' style='position:absolute;top:110px;left: 130px;width: 300px; height: 20px;'>签名<input type='text' id='charactern' class='form-control' value='" + data.charactern + "'></div>" +
            "<div style='position:absolute;top:200px;width: 636px; height: auto;min-height: 200px;margin: 20px 70px 0px 70px;'>" +
            //                    "<hr style=' height:2px;border:none;border-top:2px dotted #185598;' />" + data.userId +
            "<hr style='border-top-width: 1px; border-top-style: solid; border-top-color: #d9d9d9;;margin:0' />"
            //                + data.projects +
            //                + data.leader +
            //                + data.prizeId +
            + "<p>&nbsp;"
            + "<table>" +
            "<tr><td>性别</td><td><div class='col-sm-10'>" + sss + "</div></td></tr>" +
            "<tr><td>年龄</td><td><div class='col-sm-10'><input type='number' id='age' class='form-control' value='" + data.age + "'></div></td></tr>" +
            "<tr><td>邮箱</td><td><div class='col-sm-10'><input type='text' id='mail' class='form-control' value='" + data.mail + "'></div></td></tr>" +
            "<tr><td>电话</td><td><div class='col-sm-10'><input type='number' id='phone' class='form-control' value='" + data.phone + "'></div></td></tr>" +
            "<tr><td>户籍</td><td><div class='col-sm-10'><input type='text' id='nativeplace' class='form-control' value='" + data.nativeplace + "'></div></td></tr>" +
            "<tr><td>现居</td><td><div class='col-sm-10'><input type='text' id='city' class='form-control' value='" + data.city + "'></div></td></tr>" +
            "<tr><td>学历</td><td><div class='col-sm-10'><input type='text' id='educationexp' class='form-control' value='" + data.educationexp + "'></div></td></tr>" +
            "<tr><td>专业</td><td><div class='col-sm-10'><input type='text' id='profession' class='form-control' value='" + data.profession + "'></div></td></tr>" +
            "<tr><td>英语水平</td><td><div class='col-sm-10'><input type='text' id='englishlevel' class='form-control' value='" + data.englishlevel + "'></div></td></tr>" +
            "<tr><td>职业</td><td><div class='col-sm-10'><input type='text' id='functions' class='form-control' value='" + data.functions + "'></div></td></tr>" +
            "<tr><td>自我介绍</td><td><div class='col-sm-12'><textarea id='selfassessment' class='form-control' rows='5'>" + data.selfassessment + "</textarea></div></td></tr>" +
            "<tr><td>&nbsp</td><td>&nbsp</td></tr>" +
            "<tr><td>&nbsp</td><td>&nbsp</td></tr>" +
            "<tr><td>&nbsp</td><td>&nbsp</td></tr>" +
            "<tr><td>&nbsp</td><td></td></tr>" +

            "</table><div style='position: absolute;bottom: 20px;left: 130px;'><button type='button' id='sub1' class='btn btn-success'>提交</button></div>"

            //                + "<br>年龄：" + data.age
            //                + "<br>邮箱：" + data.mail
            //                + "<br>电话：" + data.phone
            //                + "<br>户籍：" + data.nativeplace + "&emsp; 现居:" + data.city + "&nbsp;&nbsp;" + data.area
            //                + "<p>学历：" + data.educationexp + "&emsp;" + data.education + "emsp;专业:" + data.profession + "emsp;"
            //                + "<p>英语水平：" + data.englishlevel
            //                + "<p>职业：" + data.functions
            //                + "<p>自我介绍：<p>&emsp;" + data.selfassessment
            + "</div>" +
            "<div class='container' id='crop-avatar'>" +
            "" +
            "    <!-- Current avatar -->" +
            "    <div class='avatar-view'>" +
            "        <img src='" + data.photo + "' alt='头像'>" +
            "    </div>" +
            "" +
            "    <!-- Cropping modal -->" +
            "    <div class='modal fade' id='avatar-modal' aria-hidden='true' aria-labelledby='avatar-modal-label' role='dialog'" +
            "         tabindex='-1'>" +
            "        <div class='modal-dialog modal-lg'>" +
            "            <div class='modal-content'>" +
            "                <form class='avatar-form' action='../userinfo/upload' enctype='multipart/form-data' id='fileform' method='post'>" +
            "                                <input name='file1' id='img1' type='hidden' value='222'>" +

            "                    <div class='modal-header'>" +
            "                        <button class='close' data-dismiss='modal' type='button'>&times;</button>" +
            "                        <h4 class='modal-title' id='avatar-modal-label'>更换头像</h4>" +
            "                    </div>" +
            "                    <div class='modal-body'>" +
            "                        <div class='avatar-body'>" +
            "" +
            "                            <!-- Upload image and data -->" +
            "                            <div class='avatar-upload'>" +
            "                                <input class='avatar-src' name='avatar_src' type='hidden'>" +
            "                                <input class='avatar-data' name='avatar_data' type='hidden'>" +
            "                                <label for='avatarInput'>请上传头像&emsp;&nbsp;(请使用jpg/jpeg格式)</label>" +
            "                                <input class='avatar-input' id='avatarInput' name='file1' type='file' accept='image/jpeg, image/jpg'>" +
            "                            </div>" +
            "" +
            "                            <!-- Crop and preview -->" +
            "                            <div class='row'>" +
            "                                <div class='col-md-9'>" +
            "                                    <div class='avatar-wrapper'></div>" +
            "                                </div>" +
            "                                <div class='col-md-3'>" +
            "                                    <div class='avatar-preview preview-lg'></div>" +
            "                                    <div class='avatar-preview preview-md'></div>" +
            "                                    <div class='avatar-preview preview-sm'></div>" +
            "                                </div>" +
            "                            </div>" +
            "" +
            "                            <div class='row avatar-btns'>" +
            "                                <div class='col-md-9'>" +
            "                                    <div class='btn-group'>" +
            "                                        <!--位置1-->" +
            "                                    </div>" +
            "                                    <div class='btn-group'>" +
            "                                        <!--位置2-->" +
            "" +
            "                                    </div>" +
            "                                </div>" +
            "                                <div class='col-md-3'>" +
            "                                    <button class='btn btn-default' name='sub' id='sub'>确认</button>" +
            "" +
            "                                </div>" +
            "                            </div>" +
            "                        </div>" +
            "                    </div>" +
            "                    <!-- <div class='modal-footer'>" +
            "                      <button class='btn btn-default' data-dismiss='modal' type='button'>Close</button>" +
            "                    </div> -->" +
            "                </form>" +
            "            </div>" +
            "        </div>" +
            "    </div><!-- /.modal -->" +
            "" +
            "    <!-- Loading state -->" +
            "    <div class='loading' aria-label='Loading' role='img' tabindex='-1'></div>" +
            "</div>" +
            "<script src='http://code.jquery.com/jquery-latest.js'></script>" +
            "<script type='text/javascript'>" +
            "    function sub() {" +
            "" +
            "    }" +
            "" +
            "    $('document').ready(function () {" +
            "" +
            "        $('#sub').click(function () {" +
            "" +
            "            var img = $('.cropper-canvas').attr('style') + $('.cropper-crop-box').attr('style');" +
            "            $('#img1').val(img);" +
            " document.getElementById('fileform').submit();" +
            "alert('更改成功'); " +
            "$('#sub').attr('data-dismiss','modal')" +
            "        })" +
            "    })" +
            "</script>" +
            "" +
            "<script src='../js/jquery.min.js'></script>" +
            "<script src='../js/bootstrap.min.js'></script>" +
            "<script src='../js/cropper.min.js'></script>" +
            "<script src='../js/img-main.js'></script>" +
            "</body>" +
            "</html>";
    }).error(function (data, status) {
    a = data + "<p>" + status;
})

$(function () {
    $('#myModal').on('#sub', function () {
        alert('嘿，我听说您喜欢模态框...');
    })
});

var ssex = "";
$("body").on('click', ':radio', function () {

    ssex = $(this).val();
});


$.post("../userinfo/pro", function () {
}).success(function (data, status) {

    $.each(data, function (index, item) {
        t = t + "<p><div class='col-md-3 column' style='float:left;'><table><tr><td><img style='width:100%;magin:2px;width:145px;height:88px;' alt='" + item.name + "' src='" + item.proImg + "'></td></tr><tr><td>项目名称：" + item.name + "</td></tr><tr><td>负责内容：" + item.content + "</td></tr></table></div>";
        t1 = t1 + "<table border='1'><tr><td class='id' style='display:none'>" + item.id + "</td></tr><tr><td cellpadding='20'>&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;</td><td id='xmtp'><img style='width:100%;magin:2px;width:145px;height:88px;' alt='" + item.name + "' src='" + item.proImg + "'></td><td><button class='btn btn-default bg' data-toggle='modal' data-target='#myModal12'>编辑项目</button><br><br><button class='btn btn-default del'>删除项目</button></td></tr><tr><td>&emsp;项目名称</td><td>" + item.name + "</td></tr><tr><td>&emsp;项目介绍</td><td>" + item.proShow + "</td></tr><tr><td>&emsp;评价</td><td>" + item.content + "</td></tr><tr><td>&emsp;日期</td><td>" + item.deCycle + "</td></tr><tr><td>&emsp;工具</td><td>" + item.deTool + "</td></tr><tr><td>&emsp;环境</td><td>" + item.devEnv + "</td></tr></table><p><p><p>"

    })
    t = "<div style='overflow:auto;'>" + t + "</div>"
}).error(function (data, status) {
    a = data + "<p>" + status;
})
var fa = "true";
$("body").on('focus', '#phone', function () {
    if ($("#phone").val().length != 11 && $("#phone").val().length != 0) {
        fa = "false";
        document.getElementById("phone").style.borderStyle = "solid";//边框样式
        document.getElementById("phone").style.borderColor = "#ff0000";//边框颜色
        document.getElementById("phone").style.borderWidth = "1px";//边框宽度
    } else if ($("#phone").val().length == 0) {
        document.getElementById("phone").style.borderStyle = "solid";//边框样式
        document.getElementById("phone").style.borderColor = "#ccc";//边框颜色
        document.getElementById("phone").style.borderWidth = "1px";//边框宽度
        fa = "true";
    }
})
$("body").on('blur', '#phone', function () {
    if ($("#phone").val().length != 11 && $("#phone").val().length != 0) {
        fa = "false";
        document.getElementById("phone").style.borderStyle = "solid";//边框样式
        document.getElementById("phone").style.borderColor = "#ff0000";//边框颜色
        document.getElementById("phone").style.borderWidth = "1px";//边框宽度
    } else if ($("#phone").val().length == 0) {
        document.getElementById("phone").style.borderStyle = "solid";//边框样式
        document.getElementById("phone").style.borderColor = "#ccc";//边框颜色
        document.getElementById("phone").style.borderWidth = "1px";//边框宽度
        fa = "true";
    }
})

$("body").on('click', '#sub1', function () {

    if ($("#phone").val().length == 0) {
        fa = "true";
    }
    if (fa == "true") {
        $.post("../userinfo/gai/",
            {
                a1: $("#name").val(),
                b1: $("#charactern").val(),
                a2: ssex,
                b2: $("#age").val(),
                a3: $("#mail").val(),
                b3: $("#phone").val(),
                a4: $("#nativeplace").val(),
                b4: $("#city").val(),
                a5: $("#educationexp").val(),
                b5: $("#profession").val(),
                a6: $("#englishlevel").val(),
                b6: $("#functions").val(),
                a7: $("#selfassessment").val()
            })
            .success(function (data, status) {
                alert("修改成功")
                window.location.reload();
            }).error(function (data, status) {
            alert("修改失败")

        })
    } else {
        alert("信息填写错误")
    }
})

$("#xx").click(function () {

    $("#Layer32").html(a + t + qe + te + "</div>")

});
$("#xm").click(function () {
    var mo = "<div class='modal fade' id='myModal11' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>" +
        "<div class='modal-dialog'>" +
        "<div class='modal-content'>" +
        "<div class='modal-header'>" +
        "<button type='button' class='close' data-dismiss='modal' aria-hidden='true'>" +
        "&times;" +
        "</button>" +
        "<h4 class='modal-title' id='myModalLabel'>" +
        "新增项目" +
        "</h4>" +
        "</div>" +
        "<div class='modal-body'>" +
        "<form id='f1' method='post' enctype='multipart/form-data'><table border='1'>" +
        "<tr><td>项目介绍图</td><td><input type='file' name='file1' id='xmt1'  onchange='imgPreview1(this)'></td><td><img id='xmtt1' style=\"width:100%;magin:2px;width:145px;height:88px;\" src='/zzlp/img/QQ截图20170922195823.png'></td></tr>" +
        "<tr><td>项目名称</td><td><input type='text' id='xmm1'></td></tr>" +
        "<tr><td>项目介绍</td><td><textarea id='xmjs1'></textarea></td></tr>" +
        "<tr><td>评价</td><td><textarea id='xmpj1'></textarea></td></tr>" +
        "<tr><td>日期</td><td><input type='text' id='xmrq1'></td></tr>" +
        "<tr><td>工具</td><td><input type='text' id='xmgj1'></td></tr>" +
        "<tr><td>环境</td><td><input type='text' id='xmhj1'></td></tr>" +
        "</table></form>" +
        "</div>" +
        "<div class='modal-footer'>" +
        "<button type='button' class='btn btn-default' data-dismiss='modal'>关闭" +
        "</button>" +
        "<button type='button' id='bt1' class='btn btn-primary'>" +
        "提交更改" +
        "</button>" +
        "</div>" +
        "</div><!-- /.modal-content -->" +
        "</div><!-- /.modal -->" +
        "</div>";
    var mo1 = "<div class='modal fade' id='myModal12' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>" +
        "<div class='modal-dialog'>" +
        "<div class='modal-content'>" +
        "<div class='modal-header'>" +
        "<button type='button' class='close' data-dismiss='modal' aria-hidden='true'>" +
        "&times;" +
        "</button>" +
        "<h4 class='modal-title' id='myModalLabel'>" +
        "编辑项目" +
        "</h4>" +
        "</div>" +
        "<div class='modal-body'>" +
        "<table border='1'>" +
        "<tr><td>项目介绍图</td><td><input type='file' name='file1' id='xmt'  onchange='imgPreview(this)'></td><td><img id='xmtt' style=\"width:100%;magin:2px;width:145px;height:88px;\" src='/zzlp/img/QQ截图20170922195823.png'></td></tr>" +
        "<tr><td>项目名称</td><td><input type='text' id='xmm'></textarea></td></tr>" +
        "<tr><td>项目介绍</td><td><textarea id='xmjs'></textarea></td></tr>" +
        "<tr><td>评价</td><td><textarea id='xmpj'></textarea></td></tr>" +
        "<tr><td>日期</td><td><input type='text' id='xmrq'></td></tr>" +
        "<tr><td>工具</td><td><input type='text' id='xmgj'></td></tr>" +
        "<tr><td>工具</td><td><input type='text' id='xmhj'></td></tr>" +
        "</table>" +
        "</div>" +
        "<div class='modal-footer'>" +
        "<button type='button' class='btn btn-default' data-dismiss='modal'>关闭" +
        "</button>" +
        "<button type='button' class='btn btn-primary'>" +
        "提交更改" +
        "</button>" +
        "</div>" +
        "</div><!-- /.modal-content -->" +
        "</div><!-- /.modal -->" +
        "</div>";
    $("#Layer32").html("<table><tr><td><button class='btn btn-default' data-toggle='modal' data-target='#myModal11'>新增项目</button></td></tr></button>\n</td></tr></table><br>" + t1 + mo + mo1)

});
$("body").on('click', '.del', function () {
    var mymessage = confirm("确认删除？");
    if (mymessage == true) {
        var proid = $(this).parents("table").find(".id").text();
        var thistb = $(this).parents('table');

        $.post("../userinfo/del/" + proid,
            function () {

            })
            .success(function (data, status) {
                thistb.empty();
                alert("删除成功")
            }).error(function (data, status) {
            alert("删除失败")

        })

    }
    else if (mymessage == false) {

    }

})

$("body").on('click', '.bg', function () {
    var str = $(this).parents("table").find("tr:eq(1) td:eq(1)").html();
    var xmm = $(this).parents("table").find("tr:eq(2) td:eq(1)").text();
    var xmjs = $(this).parents("table").find("tr:eq(3) td:eq(1)").text();
    var xmpj = $(this).parents("table").find("tr:eq(4) td:eq(1)").text();
    var xmrq = $(this).parents("table").find("tr:eq(5) td:eq(1)").text();
    var xmgj = $(this).parents("table").find("tr:eq(6) td:eq(1)").text();
    var xmhj = $(this).parents("table").find("tr:eq(7) td:eq(1)").text();
    var strs = new Array();
    strs = str.split("src=\"");
    var strs1 = strs[1].split("\"");
    var xmt = strs1[0];

    $("#xmtt").attr('src', xmt);
    $("#xmtt").append(xmt)
    $("#xmm").val(xmm)
    $("#xmjs").text(xmjs)
    $("#xmpj").text(xmpj)
    $("#xmrq").val(xmrq)
    $("#xmgj").val(xmgj)
    $("#xmhj").val(xmhj)

})


$("#tx").click(function () {

    $("#Layer32").html()

});
$("body").on('click', '#bt1', function () {

    $("#f1").ajaxSubmit({
        // 规定把请求发送到那个URL
        url: "../userinfo/ins1",
        // 请求方式
        type: "post",
        // 服务器响应的数据类型
        dataType: "json",
        // 请求成功时执行的回调函数
        success: function (data, status, xhr) {
            // 图片显示地址
            console.log(status)
        },
        error: function (data, status) {
            console.log(status)

        }
    });
});

function imgPreview(fileDom) {
    //判断是否支持FileReader
    if (window.FileReader) {
        var reader = new FileReader();
    } else {
        alert("您的设备不支持图片预览功能，如需该功能请升级您的设备！");
    }

    //获取文件
    var file = fileDom.files[0];
    var imageType = /^image\//;
    //是否是图片
    if (!imageType.test(file.type)) {
        alert("请选择图片！");
        return;
    }
    //读取完成
    reader.onload = function (e) {
        //获取图片dom
        var img = document.getElementById("xmtt");
        //图片路径设置为读取的图片
        img.src = e.target.result;
    };
    reader.readAsDataURL(file);
}

function imgPreview1(fileDom) {
    //判断是否支持FileReader
    if (window.FileReader) {
        var reader = new FileReader();
    } else {
        alert("您的设备不支持图片预览功能，如需该功能请升级您的设备！");
    }

    //获取文件
    var file = fileDom.files[0];
    var imageType = /^image\//;
    //是否是图片
    if (!imageType.test(file.type)) {
        alert("请选择图片！");
        return;
    }
    //读取完成
    reader.onload = function (e) {
        //获取图片dom
        var img = document.getElementById("xmtt1");
        //图片路径设置为读取的图片
        img.src = e.target.result;
    };
    reader.readAsDataURL(file);
}

$("#xm").hide();

$("body").on('click', '#jianli', function () {


    window.open("jianli.html");

})
$("#zh").click(function () {
    $("#Layer32").html("  " +
        "<div id='msg' style='position:absolute;top:210px;left:300px;height:30px;width:150px;font-family:宋体;font-size: 25px;' ><center>修改信息</center></div>" +
        "<div id='pwdChange' style='position:absolute;top:290px;left:300px;height:30px;width:150px;font-family:宋体;font-size: 25px;' ><center>修改密码</center></div>" +

        "<div id='re' style='position:absolute;top:380px;left:300px;height:30px;width:150px;font-family:宋体;font-size: 25px;' ><center>帐号注销</center></div>"
    )

    $("#msg").click(function () {
        $("#Layer32").html(b)
    })
    $("#re").click(function () {
        $.post("../userinfo/logout",
            function () {

            })
            .success(function (data, status) {
            })
        window.location.href = "login.html";

    })

    $("#pwdChange").click(function () {
        $("#Layer32").html(pwdChange);
    })
})
